﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using IDAL.A;
using Model.A;

namespace DAL.A
{
    class ATest_OSC : BaseRepository_DT<ATest_OSCInfo>, IATest_OSC  
    {
        #region 静态变量定义
        private const string PARM_ATEST_OSC_SN = "@PCBASN";
        #endregion

        #region 数据检索部分
        public IList<ATest_OSCInfo> LoadEntities()
        {
            return null;
        }

        public ATest_OSCInfo LoadEntity<T1>(T1 sn)
        {
            return null;
        }

        public IList<ATest_OSCInfo> ATest_OSC_GetbySN(string sn)
        {
            return ExcuteSqlToGetEntities("ATest_OSC_selectbySN", GetParameter());
        }

        public IList<ATest_OSCInfo> ATest_OSC_GetbyDT(DateTime dt1, DateTime dt2)
        {
            SqlParameter[] parms = GetDTParameters();
            parms[0].Value = dt1;
            parms[1].Value = dt2;
            return ExcuteSqlToGetEntities("ATest_OSC_selectbyDT", parms);
        }
        #endregion

        #region 重写基类方法
        public override ATest_OSCInfo GetEntityRecord(SqlDataReader rdr)
        {
            ATest_OSCInfo entity = new ATest_OSCInfo(rdr.GetValue(0).ToString(), rdr.GetDateTime(1), rdr.GetBoolean(2), rdr.GetValue(3).ToString()
                , rdr.GetDecimal(4), rdr.GetDecimal(5), rdr.GetDecimal(6), rdr.GetDecimal(7), rdr.GetBoolean(8));
            return entity;
        }

        public override ATest_OSCInfo GetEntityRecord()
        {
            ATest_OSCInfo entity = new ATest_OSCInfo();
            return entity;
        }

        public override SqlParameter GetParameter()
        {
            SqlParameter parm = new SqlParameter(PARM_ATEST_OSC_SN, SqlDbType.NVarChar, 50);
            return parm;
        }
        #endregion
    }
}
